{extend name='public/base' /}
{block name='content'}
{include file='public/content_header' /}
<style>
    .layui-form-label{
        width: 120px;
    }
    .layui-input-block{
        margin-left: 130px;
    }
</style>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="box box-primary layui-form">
                <!-- 表单 -->
                <form id="dataForm" class="form-horizontal dataForm" action="" method="post" enctype="multipart/form-data">
                    <!-- 表单字段区域 -->
                    <div class="box-body" style="min-height: 500px;">
                        <div class="layui-form-item">
                            <label class="layui-form-label">分销功能</label>
                            <div class="layui-input-block">
                                <input type="radio" name="is_open" value="0" title="关闭" {if $config.is_open == 0}checked{/if}>
                                <input type="radio" name="is_open" value="1" title="开启" {if $config.is_open == 1}checked{/if}>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label"></label>
                            <div class="layui-input-block layui-word-aux">
                                关闭分销功能后不会再产生新的分销佣金，商城端分销入口会关闭。
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">分销层级</label>
                            <div class="layui-input-block">
                                <input type="radio" name="level" value="1" title="一级分销" {if $config.level == 1}checked{/if}>
                                <input type="radio" name="level" value="2" title="二级分销" {if $config.level == 2}checked{/if}>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label"></label>
                            <div class="layui-input-block layui-word-aux">
                                允许发放佣金的分销层级
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">结算时机(天)</label>
                            <div class="layui-input-block" style="width: 300px;">
                                <input type="text"  name="settlement_days" value="{$config.settlement_days}" placeholder="请输入结算时机(天)" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label"></label>
                            <div class="layui-input-block layui-word-aux">
                                预估佣金结算后无法进行回收，请谨慎设置结算天数 
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">一级佣金比例(%)</label>
                            <div class="layui-input-block" style="width: 300px;">
                                <input type="text"  name="first_ratio" value="{$config.first_ratio}" placeholder="请输入一级佣金比例" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">二级佣金比例(%)</label>
                            <div class="layui-input-block" style="width: 300px;">
                                <input type="text"  name="second_ratio" value="{$config.second_ratio}" placeholder="请输入一级佣金比例" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <!-- 表单底部 -->
                    <div class="box-footer">
                        {:token()}
                        <div class="col-sm-2">
                        </div>
                        <div class="col-sm-10 col-md-4">
                            <div class="btn-group">
                                <button type="submit" class="btn flat btn-info dataFormSubmit">
                                    保存
                                </button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</section>
<script>
    /** 表单验证 **/
    $('#dataForm').validate();
</script>
<script>
    layui.config({
        version:"{$front_version}",
        base: '/static/plug/layui-admin/dist/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'element', 'jquery', 'like', 'form'], function () {
        var $ = layui.$
            , form = layui.form
            , like = layui.like
            , layer = layui.layer;

        form.render();
    });
</script>
{/block}